-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #7048: PCP heal path dependent types #7386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5f695f5
to
77081ec
Compare
def isStaticPathOK(tp1: Type): Boolean = tp1 match { | ||
case tp1: TypeRef => tp1.symbol.is(Package) || isStaticPathOK(tp1.prefix) | ||
case tp1: TermRef => tp1.symbol.isStaticOwner || isStaticPathOK(tp1.prefix) | ||
case tp1: ThisType => tp1.tref.symbol.is(Package) || tp1.tref.symbol.is(Module) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "porjection"
I don't think this is the right logic for isStaticPathOK. How about:
tp1.stripTypeVar match
case tp1: TypeRef => tp1.symbol.is(Package) || isStaticPathOK(tp1.prefix)
case tp1: TermRef => tp1.symbol.is(Module) && tp1.symbol.isStatic
case tp1: ThisType => tp1.cls.isStaticOwner
case tp1: AppliedType => isStaticPathOK(tp1.tycon)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this version it but made a couple of extra changes to make all the tests pass
c1c8ead
to
fc99492
Compare
fc99492
to
a3d351a
Compare
'[p.X]
wherep
is statically known and therefore is phase consistent.'{ val x: p.X = ... }
wherep
is not phase consistent but there is a givenType[p.X]
in scope.